PROJECTENGRAM

GROWTH RATES

Growth Rates

Tags: #◇CCDSALG #◇Algorithms #◇Computer Science #◇Computational Complexity #◇Efficiency #◇Algorithm Design Paradigms #◇Analysis of Algorithms #◇Data Structures #◇Time Complexity #◇Space Complexity


◇Overview

Growth rates describe how an algorithm’s resource usage (time or space) increases as the input size nn grows.

◇Key Concepts

Growth rate hierarchy from constant to factorial Asymptotic dominance between functions Why lower growth rates are preferred for scalability Connection to ◇Asymptotic Notation and ◇Order of Growth

◇Details / Theory

Definition

The growth rate of a function f(n)f(n) describes how quickly f(n)f(n) increases as n→∞n \to \infty. In algorithm analysis, we care about the growth rate of the ◇Running Time function T(n)T(n) because it determines how the algorithm scales.

Hierarchy of Common Growth Rates

From slowest (best) to fastest (worst) growth:

Growth RateNameExample Algorithm
Θ(1)\Theta(1)ConstantAccessing array element by index
Θ(log⁡n)\Theta(\log n)LogarithmicBinary Search
Θ(n)\Theta(\sqrt{n})Square RootTrial division primality test
Θ(n)\Theta(n)LinearLinear Search, finding max
Θ(nlog⁡n)\Theta(n \log n)LinearithmicMerge Sort, Heap Sort
Θ(n2)\Theta(n^2)QuadraticBubble Sort, checking all pairs
Θ(n3)\Theta(n^3)CubicNaive matrix multiplication
Θ(2n)\Theta(2^n)ExponentialFinding all subsets
Θ(n!)\Theta(n!)FactorialGenerating all permutations

Practical Impact

For n=1,000,000n = 1{,}000{,}000 inputs:

Growth RateApproximate Operations
O(log⁡n)O(\log n)~20
O(n)O(n)1,000,000
O(nlog⁡n)O(n \log n)~20,000,000
O(n2)O(n^2)1,000,000,000,000 (infeasible)

Asymptotic Dominance

A function f(n)f(n) dominates g(n)g(n) if lim⁡n→∞g(n)f(n)=0\lim_{n \to \infty} \frac{g(n)}{f(n)} = 0.

The dominance ordering is:
1≺log⁡n≺n≺n≺nlog⁡n≺n2≺n3≺2n≺n!1 \prec \log n \prec \sqrt{n} \prec n \prec n\log n \prec n^2 \prec n^3 \prec 2^n \prec n!

Why Growth Rates Matter

An O(nlog⁡n)O(n \log n) algorithm will always eventually beat an O(n2)O(n^2) algorithm for sufficiently large nn, regardless of constant factors. Growth rates are what ◇Asymptotic Notation captures by ignoring constants and lower-order terms.

◇Common Pitfalls

Assuming a "faster" growth rate algorithm is always faster — for small nn, constants matter. Confusing O(nlog⁡n)O(n \log n) with O(n)O(n) — the log⁡n\log n factor makes a real difference for large inputs. Forgetting that exponential and factorial growth rates are generally computationally infeasible.

◇Summary

TL;DR — Growth rates rank how fast an algorithm’s time/space grows with input size. The hierarchy from best to worst is: O(1)<O(log⁡n)<O(n)<O(nlog⁡n)<O(n2)<O(2n)<O(n!)O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!).

Related: ◇Order of Growth — ◇Asymptotic Notation — ◇Big-O Notation — ◇Time Complexity — ◇Running Time Source / Reference: Handout 03, Page 17

◇References & Navigation

CONFIRMATION // 理解度の確認

ACTIVE RECALL VERIFICATION

Select an answer to verify conceptual comprehension and reveal the technical rationale.

Q1

What do growth rates describe in algorithm analysis?

Q2

Which of the following growth rates is the slowest (best)?

Q3

Which of the following growth rates is the fastest (worst)?

Q4

What is a classic example of an algorithm with a logarithmic (Θ(log⁡n)\Theta(\log n)) growth rate?

Q5

Merge Sort and Heap Sort are examples of algorithms with which growth rate?

Q6

In terms of practical impact for n=1,000,000n = 1,000,000, roughly how many operations does an O(n2)O(n^2) algorithm perform?

Q7

What does asymptotic dominance (f(n)f(n) dominates g(n)g(n)) mean mathematically?

Q8

Why does an O(nlog⁡n)O(n \log n) algorithm eventually beat an O(n2)O(n^2) algorithm?

Q9

What is a common pitfall when comparing algorithm growth rates?

Q10

Which of the following correctly orders growth rates from slowest to fastest?

Growth Rates | PROJECT ENGRAM